<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
	<title></title>
	<script type="text/javascript" src="<%=basePath %>/bootstrap/js/jquery.js"></script>
	<script type="text/javascript" src="<%=basePath %>/bootstrap/js/bootstrap.js"></script>
	<link rel="stylesheet" href="<%=basePath %>/bootstrap/css/bootstrap.css" />
	<link rel="stylesheet" href="<%=basePath %>/bootstrap/css/bootstrap-responsive.css" />
	<style type="text/css">
		body{
			background-image:url(<%=basePath %>/bootstrap/img/1.png);
		}
		.well{
			width:300px;
			height:250px;
			margin-top:100px;
			margin-left:auto;
			margin-right:auto;
		}
	</style>
</head>
<body>
	<form class="well" action="login.action" method="post">
	<c:if test="${param.code == '1001' }">
			<div style="color:red">用户不存在</div>
		</c:if>
		<h3>登陆---售楼管理系统</h3>
		<hr />
	  <label>用户名：</label>
	  <input type="text" placeholder="用户名" class="span3" name="worker.wname" id="name" /><br/>
	  <span class="name-error"></span>
	  <label>密&nbsp;&nbsp;码：</label>
	  <input type="password" placeholder="密码" class="span3" id="password" name="worker.wpassword" /><br/>
	  <span class="password-error"></span><br/>
	  <input type="button" class="btn btn-primary" id="bttn" value="提交"/>
	  <button type="reset" class="btn">重置</button>
	</form>
	<script type="text/javascript">
		$(document).ready(function(){
			$(".btn").click(function(){
				var name= $("#name").val();
				var password = $("#password").val();
				var reg1 = /^\w{3,8}$/;
				var reg2 = /^\d{3,6}$/;
				if(!reg1.test(name)){
					$(".name-error").html("用户名是由3-8位字母或数字组成");
					return ;
				}else if(!reg2.test(password)){
					$(".password-error").html("密码是3-6位数字组成");
					return ;
				}else{
					$(".well").submit();
				}
			});
		});
	</script>
</body>
</html>